package com.hanhai.material.device.entity;

import com.hanhai.material.scheduling.entity.SysProductPeople;
import com.mybatisflex.annotation.Column;
import com.mybatisflex.annotation.Id;
import com.mybatisflex.annotation.RelationOneToOne;
import com.mybatisflex.annotation.Table;
import jdk.nashorn.internal.ir.annotations.Ignore;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.time.LocalDate;
import java.util.Date;
import java.util.List;

/**
 *  实体类。
 *
 * @author youchuang
 * @since 2024/02/16 15:49:52
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Table(value = "sys_product_record_into",dataSource = "device")
public class SysProductRecordInto implements Serializable {

    @Id
    private String id;

    private String workShop;

    private String machineName;

    private String machineArea;

    private String jobNo;

    private String userName;

    private String shift;

    private String shiftCode;

    private String workPlanId;

    private Date productDate;

    private String summary;

    @Column(onInsertValue = "now()")
    private Date createTime;

    private int goodNum;

    private int goodNumPeople;

    private int badNumPeople;

    private int badNum;

    private int totalNumPeople;

    private int totalNum;

    private Boolean isEntry;

    private int workPlanProductNum;

    private int nowProductNum;

    private int totalCount;

    private String productId;

    private String productName;

    private String shortName;

    @Column(onUpdateValue = "now()")
    private Date updateTime;

    private Boolean isAuto;

    private String endUserName;

    private String endUserId;

    private int paperBoxNumber;

    private String exchangeType;

    private Boolean moldSame;

    private int nowTailBoxCount;

    private int lastTailBoxCount;

    private int packageBoxNum;

    private int boxNum;

    private int quantity;


    private Boolean isEntryPeople;

    private int entryNum;

    @Column(ignore = true)
    List<SysProductRecordDetention> productRecordDetentionList;
    @Column(ignore = true)
    List<SysProductRecordDetentionRecord> productRecordDetentionRecordList;

    private int totalInto;

    private int totalTodayPeopleInto;

    private int totalHandleInto;

    private String productRecordId;

    private String productRecordShiftId;

    private int detentionToGoodNum;

    private int detentionToBadNum;
    private int willProcessedToGoodNum;

    private int willProcessedToBadNum;

    private int totalGoodNum;

    private int totalBadNum;

    private String createUserId;
    private String createUserName;
    private String updateUserId;
    private String updateUserName;
    private int lastTailCountInto;

    @Column(ignore = true)
    private LocalDate startDate;
    @Column(ignore = true)
    private LocalDate endDate;

    private Date actualStartTime;

    private Date actualEndTime;

    @RelationOneToOne(selfField = "productRecordShiftId",targetField = "id")
    private SysProductRecordShift productRecordShift;

    @RelationOneToOne(selfField = "productId",targetField = "productId",dataSource = "scheduling")
    private SysProductInfo productInfo;

    @RelationOneToOne(selfField = "workPlanId",targetField = "id",dataSource = "scheduling")
    private SysWorkPlan workPlan;

////
//    @RelationOneToMany(selfField = "workPlanId",targetField = "workPlanId",extraCondition = "(productDate =:productDate and status !=:status)")
//    private List<SysProductRecordDetention> productRecordDetentionList;

    private double adjustMachineDuration;

    private String adjustMachineReason;

    private String dataId;

    private String dingId;

    private int willProcessedNum;

    private int detentionNum;

    private String kingGoodId;

    private String kingGoodNo;

    private String kingBadId;

    private String kingBadNo;

    private String kingBadBmId;

    private String kingBadBmNo;

    private String kingDetentionNo;

    private String kingDetentionId;

    private String groupName;

    private int otherShiftTailBoxCount;
    private boolean isOtherShiftTailBoxEntry;
    private String otherShiftId;
    private String otherShiftKingId;
    private String otherShiftKingNo;
    @Column(ignore = true)
    private String productIdQuery;
    private String[] productIds;
    @Column(ignore = true)
    private List<SysBadRecord> badRecordList;

    @Column(ignore = true)
    private List<SysProductPeople> productPeopleList;

//    @RelationOneToOne(selfField = "machineName",targetField = "machineName",dataSource = "device")
//    private SysMachinePlc machine;



}
